#ifndef __PLUG_MQTT_H__
#define __PLUG_MQTT_H__

#include "hi_type.h"
#include "plug_common.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* End of #ifdef __cplusplus */

#define PLUG_MQTT_MAX_DEVICE_ID_LEN 64

/**
 * @brief    mqtt connect.
 * @param[in] NONE
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MQTT_Connect(HI_VOID);

/**
 * @brief    mqtt publish msg.
 * @param[in] topic: mqtt topic
 * @param[in] payload :Msg
 * @param[in] qos :mqtt qos
 * @param[in] retained :mqtt retain
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MQTT_PubClient(const HI_S8* topic,HI_S8 *payload,HI_S32 qos,HI_BOOL retained);

/**
 * @brief    mqtt subscribe.
 * @param[in] topic: mqtt topic
 * @param[in] qos :mqtt qos
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MQTT_SubClient(const HI_S8* topic, HI_S32 qos);

/**
 * @brief    mqtt un subscribe.
 * @param[in] topic: mqtt topic
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MQTT_UnSubClient(const HI_S8* topic);

/**
 * @brief    mqtt disconnect.
 * @param[in] NONE
 * @return 0 success,non-zero error code.
 * @exception    None
 */
HI_S32 PLUG_MQTT_Disconnect(HI_VOID);

#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* End of #ifdef __cplusplus */

#endif

